GBML manual / Constants

SPRITECOLOR_RAINBOW

A rainbow: the color runs through red, yellow, green, blue and violet as it goes down the screen.

Works differently on Game Boy - On the Game Boy the look changes one shade of the sprite in bands (see sprite_color_look); one such look runs at a time.

Works differently on Game Boy Color - On the Game Boy Color the look's colors go row by row into one color of the sprite's palette (see sprite_color_look); one such row-by-row color runs at a time.

Sega Genesis: not built yet

On other consoles this differs: see Side by side and How the consoles differ.

Syntax

SPRITECOLOR_RAINBOW: constant

<!-- GENERATED by tools/gbabel_looks.py from its LOOKS registry. Never edit this page: change the registry and re-run it. -->

Description

Names the rainbow, for sprite_color_look. The color you picked is red on the top row of the screen, then orange, yellow, green, blue, and violet on the bottom row, with a smooth blend between. A sprite that stands still has a stripe of every color in it, and one that moves down the screen passes through them all.

strength is how rich the colors are: 1 is a pale pastel rainbow, 2 is in between and 3 is the full bright rainbow.

A real capture, four pictures of the same striped lighthouse - first in its own colors, then with SPRITECOLOR_RAINBOW on its red stripes at strength 1, 2 and 3 (the stripes turn green, a pale mint at strength 1 and a bright green at strength 3, because that is the part of the rainbow at the height of the lighthouse) - the colors held in the same place each timeA real capture, four pictures of the same striped lighthouse - first in its own colors, then with SPRITECOLOR_RAINBOW on its red stripes at strength 1, 2 and 3 (the stripes turn green, a pale mint at strength 1 and a bright green at strength 3, because that is the part of the rainbow at the height of the lighthouse) - the colors held in the same place each time
A real capture, four pictures of the same striped lighthouse - first in its own colors, then with SPRITECOLOR_RAINBOW on its red stripes at strength 1, 2 and 3 (the stripes turn green, a pale mint at strength 1 and a bright green at strength 3, because that is the part of the rainbow at the height of the lighthouse) - the colors held in the same place each time

The same picture four times: straight, then strength 1, 2 and 3 from left to right, each one standing still where the pattern had got to. Real pictures from a Game Boy Advance ROM.

speed is how many rows the colors slide down the screen every frame. 0 holds them still, a negative number sends them up, 0.25 is slow and 1 is quick. The colors belong to the rows of the screen, so a sprite that moves down the screen passes through them.

A real capture, 16 frames played in a loop - the red stripes of the lighthouse change through the colors of the rainbow as the colors slide down the screenA real capture, 16 frames played in a loop - the red stripes of the lighthouse change through the colors of the rainbow as the colors slide down the screen
A real capture, 16 frames played in a loop - the red stripes of the lighthouse change through the colors of the rainbow as the colors slide down the screen

The pattern moving, sped up: sixteen real pictures four frames apart, played 70 milliseconds each, at strength 3. It is a whole turn of the pattern, so the loop has no seam. This picture is an animated PNG; a viewer that cannot animate shows its first frame.

Example

sprite_color_look(spr_doc_hero, 3, SPRITECOLOR_RAINBOW, 2, 0.5);

A color that runs through the whole rainbow. Call it once, for example when the room starts - it keeps going by itself until you call sprite_color_look(spr_doc_hero, 3, SPRITECOLOR_NONE, 0, 0) or a room is loaded.

See also: sprite_color_lookSPRITECOLOR_NONESPRITECOLOR_FIRE